package com.tnl.app.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.biz.hunter.db.entity.UserInfo;
import com.tnl.app.entity.City;
import com.tnl.base.BaseDAO;


@Repository
public class CityDAO {
	private static final String SQL_GET_ID = "select * from tb_city  where id = ?";
	private static final String SQL_GET_NAME = "select * from tb_city  where Name = ?";
	private static final String SQL_GET_ALL = "select * from tb_city ";
	
	
	public List<City> getALL() {

		return BaseDAO.queryForList(City.class, SQL_GET_ALL);

	}
	
	
	
	public City getById(int Id) {
		return  BaseDAO.queryForObject(City.class, SQL_GET_ID, Id);
	}
	public City getByName(String name){
		return  BaseDAO.queryForObject(City.class, SQL_GET_NAME, name);
	}


}
